Repository navigation
fix(studio): a sealed resize, move or turn typed or made by the agent shows in the preview - #8283
Merged
Merged
Conversation
Contributor
Edit accuracy: accurate 271 (base branch 271), smooth 75 of thoseThe gate passes. Quarantined, measured but not gated (0) |
vanceingalls
approved these changes
Nov 20, 2026
vanceingalls
left a comment
Collaborator
There was a problem hiding this comment.
Approving at 8ec24eba. I found no blocker.
- Unsealed path unchanged.
selection.handleis unset, soeditSealedSelectionreturns null andafterSealedDraw(null, …)saves synchronously withdrawn=true. That gives the sameskipRefreshand.catchas before. - Sealed draw. The wait is bounded at 300 ms. If the frame is silent or the draw isn't applied,
drawn=false, so the frame reloads. Nothing hangs or gets stuck. - Failed save.
restore()runs before the rethrow. Thebeforesnapshot records an absent attribute as null, so restore removes it again. Names that a later edit owns are left alone. - Drag-end skip. Each draft end (
endManualOffsetDragMembers,endResizeWithoutMember,endRotationGestureIfCurrent) runs in.finallyafter the commit, so the draft is still live at the drag-end save. A cancelled drag's leftover draft is cleared byrestoreStudioPathOffsetandrestoreStudioBoxSize. - Stand-in copies. They are kept per frame and per handle, and consumed on the next re-read, so nothing leaks across selections.
- Fails-without claims. All three hold: the draw tests assert on the frame's
card.style, the restore test comparescssText, and the live-draft test would see 200px instead of 150px.
Non-blocking:
- The restore test covers styles only. Absent-attribute restore is tested only in core's
editElementtests. - A keyboard-nudge draft that is still live while someone types in the inspector skips the typed draw, so the frame can show the nudge value until the next reload. It's a rare race.
- If one sealed draw times out during fast typed commits, the 300 ms wait could let a later save land first.
CI: every check finished and passed or was skipped, except "Studio and player captures" (run 44713055184). That job was cancelled 8 s into setup, at 8ec24eba. It needs a re-run if it's required for merge.
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
In a sealed preview (Studio cannot script the frame), a resize, move or turn that is not a drag now shows in the preview when it is made:
Before, each was saved but the preview kept the old geometry until something later reloaded it, so the inspector and the canvas disagreed. Drags were already right: they draw on the frame as they go.
The sealed preview is off by default until the sealed-by-default change (#7846) lands, so nothing changes for anyone before then.
Why
These edits write the new size, translate or rotate on the selection's element and save with no reload, trusting that element to be what the preview shows. In a sealed preview that element is Studio's stand-in, so the frame never got the edit. A drag draws the same values on the frame through its own draft, which is why drags looked right.
How
commitPositionPatchToHtml, which every geometry save goes through, draws the patch's own inline styles and attributes on the frame's element when the preview is sealed. It uses the same steps as a sealed style save (#8279):editSealedSelection), waited for briefly before saving, with a reload if the frame never answers;A save made at the end of a drag skips this: the drag's live draft already shows it.
A sealed move typed in the inspector takes the plain translate route, which reads the stand-in's own translate marks, so its input is right. The left/top route, which measures the element's computed position, is only reached by a GSAP-owned element, and a stand-in never reads as GSAP-owned.
Test plan
geometryCommits.sealed.test.ts, on a sealed frame served by the real runtime agent:fails without the fix:
Run on Linux: the new tests (6) and the position-commit tests pass three runs in a row; Studio's
hooks,components/editorandwebmcptests (4038) pass; Studiotscno errors; format clean; the code audit passes.Bench
Edit-accuracy bench, nudge cases at r0 (60) and resize cases at r0, root, 100% zoom (18), at main and at this head:
smoothonly)smoothonly)Unsealed: no change (
smoothis reported, not gated). Sealed: no change either way. These cases are drags and arrow-key nudges, not the typed or agent edits this fixes. Their sealed misses (nudgetrackingandundo, resize-dragdropandteleport) are as on main and are tracked separately.Before
Sealed preview at main,
inline-text-caretfixture: Title selected, X typed as 300 in the Layout group. The inspector says 300px; the preview's Title has not moved.After
The same at this head: the Title moves 300px and the selection follows it.